package com.java1412.service.impl;

import com.java1412.entity.User;
import com.java1412.service.MyService;

import javax.jws.WebService;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author java1412
 * @create 2021-07-15 15:54
 */
@WebService(serviceName = "MyService",// 与接口中指定的服务name一致
        targetNamespace = "http://service.java1412.com",// 与接口中的命名空间一致，一般是接口的包名倒序
        endpointInterface = "com.java1412.service.MyService" // 接口地址
)
public class MyServiceImpl implements MyService {
    @Override
    public String sayHello(String msg) {
        return "收到的信息是:--->" + msg + ",现在时间是:--->" + new Date();
    }

    @Override
    public List<User> getUsers() {
        List<User> users = new ArrayList<>();
        users.add(new User(1L, "java1412", "北京"));
        users.add(new User(2L, "java1412", "上海"));
        users.add(new User(3L, "java1412", "南京"));
        return users;
    }
}
